﻿<h3>
    Features - Dependency Injection - Basics</h3>
<hr>
<p>
    Adds dependency injection to jQuery. Add a Joo.Dependency object to the public interface
    of your class and it will be replaced by the desired mapping when you instantiate
    your class using the IOC resolve method.</p>
<h4>
    Example</h4>
<pre>Joo.Cat = $.class.define(function() {
	var self = {
		box : new Joo.Dependency('IBox'),
		doBusiness : function(a) { 
			self.box.poop();
		}
	};
	return self;
});

Joo.LitterBox = $.class.define(function() {
	var _isStinky = false;
	var self = {
		poop : function() { 
			_isStinky = true;
		},
		clean : function() {
			_isStinky = false;
		},
		isStinky : function() {
			return _isStinky;
		}
	};
	return self;
});

$.ioc.register('IPet', Joo.Cat);
$.ioc.register('IBox', Joo.LitterBox);

var cat = $.ioc.resolve('IPet');
cat.doBusiness();
cat.box.isStinky(); // True</pre>
